<?
include_once('conn.php');
include_once('include/func.php');
include("admin_check.php") ;
if($admin[0][2]<>10){exit('<script>alert("您没有权限"); window.history.back(-1);</script>');}
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo systemname;?></title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
	<!-- jquery packed -->
	<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="js/dtree.js"></script>
	<!-- tableRowCheckboxToggle -->
	<script type="text/javascript" src="js/tableRowCheckboxToggle.js"></script>

</head>
<body>
<div id="wrap">
<div id="main" class="clearfix">
<div id="side">
  </div>
  <div id="head"><? include_once('admin_head.php');?></div><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="19%" valign="top"><div id="left"><?
  include_once('admin_menu.php');
  ?></div></td>
    <td width="81%" valign="top"><div id="right"><img src="images/ttfjpg.php?t=模块插件&amp;bg=titlebg2.jpg&amp;z=18&amp;x=5&amp;y=22&amp;r=0&amp;b=0&amp;g=0"  /><br />
<?
include('include/notify.php');



  function check_module($name,$get_v){
	  global $db; global $tablepre;
	  $check = $db->select("SELECT name,active FROM `".tablepre."module` where name='".$name."'");
	  if($check[0][0]==TRUE){
		  if($check[0][1]==TRUE){
			  		  $get_key = notify($_SERVER['HTTP_HOST'],parameters(22),'getkey');
			if($get_key=='FALSE' || $get_key== FALSE){
				//if($get_key==null){
				$db->UPDATE("UPDATE `".tablepre."module` SET `active`='0' WHERE (`name`='".$name."')");
				echo '您没有'.$name.'模块使用权';}else{echo '<a href="?'.$name.'">管理'.$name.'模块</a>';}
			  
			  }else{
				  echo '检查到'.$name.'模块 <a href="?'.$get_v.'&active='.$name.'">是否启用</a>';
				  }
		  }else{
			  $db->INSERT("INSERT INTO `".tablepre."module` (`name`) VALUES ('".$name."')");
			  return header("Location: $nowpage?".$get_v);
			  }
	  }
	function active($active,$get_v){
		global $db; global $tablepre;
		$db->UPDATE("UPDATE `".tablepre."module` SET `active`='1' WHERE (`name`='".$active."')");
		return header("Location: $nowpage?".$get_v);
		}
	function iframe($filename){
		return '
		<iframe src="module/'.$filename.'.php" frameborder="0" scrolling="yes" height="580" width="100%" noresize="noresize"></iframe>  
		
		';
		}
  if(isset($_GET[shop])){
	  //echo parameters(1);
	  eval("\$shop = ".parameters(1));
		foreach($shop as $value){
	  if(is_file('module/'.$value.'.php')){
		  check_module($value,'shop');
		  if(isset($_GET[active])){active($value,'shop');}
		  $is_module .= 1;
		  }
		}
		if($is_module==null){ echo '没有安装模块';}
	  }
	  
	  eval("\$shop = ".parameters(1));
	  foreach($shop as $value){
		  if(isset($_GET[$value])){
		echo iframe($value);
		}
		  }
		  
	  if(isset($_GET[pay])){
	  eval("\$pay = ".parameters(2));
	  //echo parameters(2);
	 // print_r($pay);
		foreach($pay as $value){
	  if(is_file('module/'.$value.'.php')){
		  check_module($value,'pay');
		  if(isset($_GET[active])){active($value,'pay');}
		  $is_module .= 1;
		  }
		}
		if($is_module==null){ echo '没有安装模块';}
	  
	  }
	  eval("\$pay = ".parameters(2));
	  foreach($pay as $value){
		  if(isset($_GET[$value])){
		echo iframe($value);
		}
		  }
	
	  
  ?></div></td>
  </tr>
</table>

  
  
  </div>
  </div>

<div id="footer">
<?
include_once('fooder.php');
?>
</div>
</BODY>
</HTML>
